package org.example;

import lombok.extern.slf4j.Slf4j;
import org.example.elastic.lite.handler.DynamicScanElasticJobHanlder;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * 启动
 * @author 魏荣杰
 * @date 2022/11/11 10:47
 * @since
 * @version
 */
@Slf4j
@SpringBootApplication
public class ElasticJobLiteApplication implements CommandLineRunner {

    @Resource
    private DynamicScanElasticJobHanlder dynamicScanElasticJobHanlder;


    public static void main(String[] args) {
        SpringApplication.run(ElasticJobLiteApplication.class, args);
    }


    @Override
    public void run(String... args) throws Exception {
        log.info("ElasticJobApplication start scanAddJob");
        dynamicScanElasticJobHanlder.scanAddJob();
    }
}
